package com.catdou.formatter.business.controller;

import com.catdou.formatter.business.model.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author James
 */
@RestController
@RequestMapping(value = "/user")
@Api(tags="用户模块")
public class UserController {
    private static final Logger LOGGER = LoggerFactory.getLogger(UserController.class);

    @ApiOperation(value = "json增加用户")
    @PostMapping(value = "/json")
    public User addUserJson(@RequestBody User user) {
        LOGGER.info("current user {}", user);
        return user;
    }

    @ApiOperation(value = "form表单增加用户")
    @PostMapping(value = "/form")
    public User addUserForm(User user) {
        LOGGER.info("current user {}", user);
        return user;
    }
}
